/**
 * @properties={typeid:24,uuid:"3909DF74-39D0-4DB2-87BE-6983DA5CC0DB"}
 * @AllowToRunInFind
 */
function validar() {
	if (globals.gEstadoAbm == 1)
	{
		controller.setSelectedIndex(1)
		var $sql = 'SELECT codigo FROM monedas WHERE codigo = ?'
		var $args = [codigo]
		var $ds = databaseManager.getDataSetByQuery('contable',$sql,$args,-1)
		if ($ds.getMaxRowIndex() != 0) 
		{		
			return [false,"El código ingresado ya existe"]
		}
	}
	return [true]
}

/**
 * @properties={typeid:24,uuid:"50C4085A-E682-42F2-8661-A71EFB9F9632"}
 */
function imprimir() {
	//forms.monedas_impresion.controller.showPrintPreview()
	jasper('impresion')
}

/**
 * @properties={typeid:24,uuid:"90831352-ECCA-4A76-82F9-902109461D1F"}
 */
function pdf()
{
	//globals.metodoPdf('monedas_impresion','Monedas - '+globals.glegajo,true)
	jasper('pdf')
}

/**
 * @properties={typeid:24,uuid:"74116383-8D7D-48EA-9226-BC51BE47D337"}
 */
function xls()
{
	jasper('xls')
}

/**
 * @properties={typeid:24,uuid:"45621A1C-A63F-4F7E-A4E3-42CEDB1C9062"}
 */
function csv()
{
	jasper('csv')
}

/**
 * @param {String} tipo
 *
 * @properties={typeid:24,uuid:"05906058-D04E-4902-B90A-843C5297C2A6"}
 */
function jasper(tipo)
{
	var $params = {
		userv: usuarios_to_uservs.razon_social
	}
	
	globals.metodoJasper(tipo,'contable/monedas.jasper','Monedas',foundset,$params)
}